package chapter;

import java.awt.Color;
import java.awt.Graphics;

import javax.swing.JFrame;
import javax.swing.JPanel;

/**
 * description: 使用java代码输出中秋节快乐
 * @version v1.0
 * @author w
 * @date 2019年9月13日下午10:06:31
 * @see https://mp.weixin.qq.com/s/8SxDT1v9LmXl9FuS3aNNiA
 **/

public class AutumnFestival extends JPanel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	
	public static void main(String[] args) {
		JFrame frame = new JFrame();
		frame.setTitle("2019中秋佳节快乐");
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setAlwaysOnTop(true);
		frame.setBackground(Color.orange);
		frame.setSize(400, 400);
		
		AutumnFestival festival = new AutumnFestival();
		frame.add(festival);
		frame.setVisible(true);
	}
	
	@Override
	protected void paintComponent(Graphics g) {
		g.drawOval(30, 30, 300, 300);
		g.drawString(" ^ _ ^", 175, 155);
	//	g.drawString("一个简单好吃的月饼呢！", 110, 175);
		g.drawString("雕儿~ 吃月饼", 110, 175);
	}
}
